package cn.byapps.master.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * 资源映射路径
 */
@Configuration
// @EnableWebMvc
public class MyWebAppConfigurer implements WebMvcConfigurer {

	@Value("${upload.url}")
	private String tempURL;
	@Value("${upload.path}")
	private String path;

	@Override
	public void addResourceHandlers(ResourceHandlerRegistry registry) {
		registry.addResourceHandler(tempURL + "**").addResourceLocations("file:" + path);
	}
}